<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="base.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>修改密码</title>
		<link rel="stylesheet" type="text/css" href="style/style.css" />
		<style type="text/css" >
			span{
				display:none;
			}
		</style>
		<script type="text/javascript" src="${basePath }/script/jquery-1.3.2.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$("#modifyForm").submit(function(){
				if($.trim($("#oldpassword").val()) == null || !$.trim($("#oldpassword").val()).match(/([\w]){6,15}$/)){
					 	$(".oldpasswordmsg").css("display","block");
					 	return false;
					}
					if($.trim($("#newpassword").val()) == null || !$.trim($("#newpassword").val()).match(/([\w]){6,15}$/)){
					 	$(".newpasswordmsg").css("display","block");
					 	return false;
					}
					if($.trim($("#confim").val()) == null || $.trim($("#confim").val()) != $.trim($("#newpassword").val())){
					 	$(".confimmsg").css("display","block");
					 	return false;
					}
				return true;
				});
			});
		</script>
	</head>

	<body>
		<%@include file="template/top.jsp"%>

		<div id="contain">
		<div class="nav">
    	<a href="index.jspx">论坛首页</a>
        &gt;&gt;
       修改密码
  </div>	
			<div class="board">
				<div class="board_title">
					修改密码
				</div>
				<div class="reg_login">
					<div class="left">
						<c:if test="${not empty msg }">
							<div class="error" style="width: 300px;">
								${msg }
							</div>
							<c:remove var="msg" scope="session" />
						</c:if>
						<form action="user.jspx" method="post" id="modifyForm">
							<input type="hidden" name="_method" value="modify" />
							<input type="hidden" name="id" value="${user.id }"/>
							<label>
								请输入原始密码：
							</label>
							<input type="password" name="oldpassword" id="oldpassword" class="text" />
							 <span class="oldpasswordmsg">密码只能由6-15位英文字母、数字及下划线组成</span>
							<label>
								请输入新密码：
							</label>
							<input type="password" name="newpassword" id="newpassword" class="text" />
							 <span class="newpasswordmsg">密码只能由6-15位英文字母、数字及下划线组成</span>
							<label>
								请再次输入新密码：
							</label>
							<input type="password" name="confim" id="confim" class="text" />
							 <span class="confimmsg">两次输入密码不一致</span>
							<div>
								<input type="submit" value="修改密码" />
							</div>
						</form>
					</div>
					<div class="right">
						<h3>
							已有账户
						</h3>
						<span>已经有了一个账户?直接<a href="index.jspx?_method=login">登录</a>
						</span>
					</div>
				</div>
			</div>
		</div>

		<%@include file="template/footer.jsp"%>

	</body>
</html>
